//
//  HZJMainViewController.swift
//  HZJGTEST
//
//  Created by 运车管家 on 2017/8/25.
//  Copyright © 2017年 运车管家. All rights reserved.
//

import UIKit

class HZJMainViewController: HZJBaseViewController {
    
    var btnTitleArray:[String] = []

    override func viewDidLoad() {
        super.viewDidLoad()
        self.edgesForExtendedLayout = .all
        
        self.myNavigationBar.tintColor = .brown
        self.myNavigationBar.isTranslucent = true
        self.myNavigationBar.setBackgroundImage(UIImage(), for: .default)
        
        btnTitleArray = ["one","two","three"]
        setUpUI()
    }
    
    func setUpUI(){
        
        let btnW = 100
        for i in 0..<2 {
            let btn = UIButton(frame: CGRect(x: 0, y: 0, width: btnW, height: btnW))
            btn.backgroundColor = .brown
            btn.center = CGPoint(x: self.view.center.x * CGFloat(i) + self.view.center.x * 0.5, y: self.view.center.y)
            btn.tag = i
            btn.setTitle(title, for: .normal)
            btn.addTarget(self, action: #selector(clickTheBtn(btn:)), for: .touchUpInside)
            self.view.addSubview(btn)
        }

    }
    
    @objc func clickTheBtn(btn:UIButton) {
        var vc:UIViewController!
        print(btn.tag)
        if btn.tag == 0 {
            vc = HZJSaveViewController()
        }else if btn.tag == 1 {
            vc = HZJBaseTabViewController()
        }
        self.navigationController?.pushViewController(vc, animated: true)

    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
    }

}
